home *** CD-ROM | disk | FTP | other *** search
- //=====================================================================
- //
- // dpmirun.h
- //
- // header file for dpmirun
- //
- // Copyright (c) 1994, Kevin Morgan, All rights reserved.
- //
- //=====================================================================
- #ifndef __DPMIRUN_H__
- #define __DPMIRUN_H__
- #include <stdio.h>
- #include <fcntl.h>
- #include <string.h>
- #include <sys\types.h>
- #include <io.h>
- #include <stdlib.h>
- #include <dos.h>
- #include <conio.h>
- #include <setjmp.h>
- #include <stdarg.h>
- #include "dpmish.h"
- #include "dosext.h"
-
- typedef unsigned char BYTE;
-
- typedef unsigned int WORD;
-
- typedef unsigned long DWORD;
-
- typedef unsigned int Selector;
-
- //=====================================================================
- //
- // ModuleLoader
- //
- // this is an abstract class to represent the program loader.
- // We hide the gory details in a subclass
- //
- //=====================================================================
- class near ModuleLoader {
- public:
- ModuleLoader() {}
- virtual int loadErrors() = 0;
- virtual void adjustSelectors() = 0;
- virtual void _far *entryPoint() = 0;
- virtual char *describeFaultPc(WORD& nearCs, WORD cs, WORD ip) = 0;
- virtual void far *getStack(unsigned) = 0;
- virtual void loadExecutable(char *) = 0;
- };
-
- ModuleLoader *newModuleLoader();
-
- void kprintf(char *,...);
-
- void dprintf(char *,...);
-
- void initComm(int,int,int);
-
- void termComm(int);
-
- void readComm(int, CommRequest far *);
-
- void writeComm(int, CommRequest far *);
-
- int handleInt86(int intNr, REGS far *inregs, REGS far *outregs);
-
- int handleInt86x(int intNr, REGS far *inregs, REGS far *outregs,
- SREGS far *segregs);
-
- #endif